<template>
  <div
    class="login-wrapper"
    :style="{
      background: `url(${companyLoginImg}) no-repeat center center`,
      
    }"
  >
    <div class="top-nav"></div>
    <div class="container">
      <div class="left d-flex" style="margin-top: -525px">
        <img :src="companyLoginLogo" alt="logo" />
        <h1 class="title ml-20 font-bold" style="color: #333">
          {{companyName}}
        </h1>
      </div>
      <div class="right">
        <div class="login-main-content">
          <div class="logo-box text-center">
            {{ titleMap[activeCom] }}
          </div>
          <component :is="activeCom" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import LoginByPwd from "./component/LoginByPwd";
import { mapGetters } from "vuex";
export default {
  name: "Login",
  components: {
    LoginByPwd,
  },
  data() {
    return {
      activeCom: "LoginByPwd",
      titleMap: {
        LoginByPwd: "欢迎登录系统",
      },
    };
  },
  computed: {
    ...mapGetters([
      "companyLoginImg",
      "companyLoginLogo",
      "companyName",
    ]),
  },
};
</script>

<style scoped lang="scss">
.login-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  display: flex;
  flex-direction: column;
  overflow: auto;

  .top-nav {
    width: 100%;
    padding: 23px 2.8% 0;
    display: flex;
    img {
      width: 164px;
      height: 50px;
    }
  }

  .container {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    margin-top: -42px;
    .left {
      align-items: center;
      img {
        width: 52px;
        height: 52px;
        margin-right: 17px;
      }
      .title {
        font-size: 32px;
        color: white;
        letter-spacing: 3px;
        margin: 0;
        // @media screen and (max-width: 1550px) {
        //   font-size: 32px;
        //   margin-top: 0;
        // }
      }
    }
    .right {
      width: 480px;
      margin-left: 227px;
      padding-top: 10px;
      .login-main-content {
        position: relative;
        width: 100%;
        height: 540px;
        background-color: white;
        border-radius: 6px;
        overflow: hidden;
        .logo-box {
          position: relative;
          width: 100%;
          font-weight: bold;
          font-size: 20px;
          color: #333;
          letter-spacing: 2px;
          padding: 0 40px;
          margin: 60px 0 65px;
          &:before {
            position: absolute;
            bottom: -12px;
            left: 50%;
            margin-left: -17px;
            content: "";
            width: 34px;
            height: 4px;
            background-color: #409eff;
            border-radius: 2px;
            display: block;
          }
        }
      }
    }
  }
}
</style>
